﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/Menu.Master" AutoEventWireup="true" CodeBehind="OurMenu.aspx.cs" Inherits="RestaurantManagerWebApp.Pages.OrderManagement.OurMenu" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="ContentPlaceHolder2">
    <p>
        Menu Category<br />
    </p>
    <asp:ListView ID="ListView1" runat="server" DataKeyNames="c_id" DataSourceID="SqlDataSource_menuCategory">
        <EmptyDataTemplate><span>No data was returned.</span></EmptyDataTemplate>
        <ItemSeparatorTemplate><br /></ItemSeparatorTemplate>
        <ItemTemplate>
            <li style="background-color: #FFFBD6;color: #333333;">
                <a href='<%#VirtualPathUtility.ToAbsolute("~/Pages/OrderManagement/OurMenu.aspx?CategoryId=" + Eval("c_id")) %>'> <%#Eval("c_name")%> </a>
            </li>
        </ItemTemplate>
        <LayoutTemplate>
            <ul id="itemPlaceholderContainer" runat="server" style ="font-family: Verdana, Arial, sans-serif;">
                <li runat="server" id="itemPlaceHolder"></li>
            </ul>
            <div style="text-align:left; background-color: blue; font-family: Verdana, Arial, sans-serif; color:black;"></div>
           
        </LayoutTemplate>

    </asp:ListView>
    <p>
        <asp:SqlDataSource ID="SqlDataSource_menuCategory" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT [c_id], [c_name] FROM [Category]"></asp:SqlDataSource>
    </p>
</asp:Content>
<asp:Content ID="Content3" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <asp:Label runat="server" ID="lblShowCategory" Font-Size="X-Large"></asp:Label>
    <asp:ListView ID="ListView2" runat="server" DataKeyNames="d_name" DataSourceID="SqlDataSource_Dish" GroupItemCount="3" style="margin-right: 413px; margin-left: 100px;" >
        <EmptyDataTemplate>
            <table runat="server" style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
                <tr>
                    <td>No data was returned.</td>
                </tr>
            </table>
        </EmptyDataTemplate>
        <EmptyItemTemplate>
<td runat="server" />
        </EmptyItemTemplate>
        <GroupTemplate>
            <tr id="itemPlaceholderContainer" runat="server">
                <td id="itemPlaceholder" runat="server"></td>
            </tr>
        </GroupTemplate>
        <ItemTemplate>
            <td runat="server" style="background-color: #FFFBD6; color: #333333;">
                <asp:Image ID="pathnameLabel" runat="server" ImageUrl='<%# Eval("pathname") %>' Height="180px" Width="191px" />
                <br />
                <asp:Label ID="d_nameLabel" runat="server" Text='<%# Eval("d_name") %>' />
                <br />
                <br />$
                <asp:Label ID="priceLabel" runat="server" Text='<%# Eval("price") %>' />
                <br />
                <asp:Label ID="descriptionLabel" runat="server" Text='<%# Eval("description") %>' />
                <br />     
                <asp:Button ID="btnAddtoOrder" runat="server" Text="Add to Order" />          
            </td>
        </ItemTemplate>
        <LayoutTemplate>
            <table runat="server">
                <tr runat="server">
                    <td runat="server">
                        <table id="groupPlaceholderContainer" runat="server" border="1" style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                            <tr id="groupPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr runat="server">
                    <td runat="server" style="text-align: center;background-color: #FFCC66; font-family: Verdana, Arial, Helvetica, sans-serif;color: #333333"></td>
                </tr>
            </table>
        </LayoutTemplate>
        <SelectedItemTemplate>
            <td runat="server" style="background-color: #FFCC66; font-weight: bold;color: #000080;">d_name:
                <asp:Label ID="d_nameLabel" runat="server" Text='<%# Eval("d_name") %>'  />
                <br />status:
                <asp:Label ID="statusLabel" runat="server" Text='<%# Eval("status") %>' />
                <br />price:
                <asp:Label ID="priceLabel" runat="server" Text='<%# Eval("price") %>' />
                <br />description:
                <asp:Label ID="descriptionLabel" runat="server" Text='<%# Eval("description") %>' />
                <br />c_id:
                <asp:Label ID="c_idLabel" runat="server" Text='<%# Eval("c_id") %>' />
                <br />pathname:
                <asp:Label ID="pathnameLabel" runat="server" Text='<%# Eval("pathname") %>' />
                <br />
            </td>
        </SelectedItemTemplate>
    </asp:ListView>
    <asp:SqlDataSource ID="SqlDataSource_Dish" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT d.d_name, d.status, d.price, d.description, d.c_id, p.pathname FROM Dish AS d INNER JOIN Photos AS p ON d.d_name = p.d_name WHERE (d.c_id = @c_id)">
        <SelectParameters>
            <asp:QueryStringParameter Name="c_id" QueryStringField="CategoryId" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>

